package spring.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import spring.demo.entity.Course;
import spring.demo.mapper.CourseMapper;

@RestController
@RequestMapping("/class")
public class ClassController {

    @Autowired
    private CourseMapper courseMapper;

    @RequestMapping("/id/{id}")
    public Course findCourseById(@PathVariable String id) {
        return courseMapper.findCourseById(id);
    }
}
